﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using QD.Snapshot.Core.Util;
using System.Threading;

namespace QD.Snapshot.Core.Form
{
    public class FormBase : System.Windows.Forms.Form
    {
        protected void Echo(TextBox textbox, string msg)
        {
            EchoHelper.ShowMessage(textbox, msg);
        }

        protected void Log(string filename, string msg)
        {
            Pigeon.Utility.Log.Write(string.Format("{0}_{1}.log", filename, DateTime.Now.ToString("yyyyMMdd")), msg);
        }

        protected void AbortThread(List<Thread> listThread)
        {
            foreach (var item in listThread)
            {
                if (item.ThreadState != ThreadState.Aborted)
                    item.Abort();
            }
        }
    }
}